import requests
import logging
class Test_wdmovie:
    uid=""
    sid=""
    def setup_method(self):
        print("开始")
    def teardown_method(self):
        print("结束")
    def test_dl(self):
        try:
            url="http://10.59.9.18/movieApi/user/v2/login"
            data={"email":"1478997572@qq.com","pwd":"eWLPHopE945d2ivttHaQTQ=="}
            r=requests.post(url=url,data=data)
            print(r.json())
            logging.info(r.json())
            Test_wdmovie.uid=str(r.json()['result']['userId'])
            Test_wdmovie.sid=r.json()['result']['sessionId']
            assert "1565539200000" in r.json()
        except Exception as e:
            logging.info(e)
            logging.info("出错了")
        finally:
            print("结束")
    def test_lb(self):
        try:
            url="http://10.59.9.180/movieApi/movie/v2/findComingSoonMovieList"
            headers={"userId":str(Test_wdmovie.uid),"sessionId":Test_wdmovie.sid}
            data={"page":1,"count":10}
            r=requests.get(url=url,headers=headers,data=data)
            print(r.json())
            logging.info(r.json())
        except Exception as e:
            logging.info(e)


